package com.qn.analyze.controlle;

import cn.dev33.satoken.annotation.SaCheckLogin;
import cn.dev33.satoken.annotation.SaIgnore;
import com.qn.analyze.entity.IpAddressMetrics;
import com.qn.analyze.entity.IpAddressRiskMetrics;
import com.qn.analyze.service.IpAddressMetricsService;
import com.qn.analyze.vo.IpaddressMetricsQueryVo;
import com.qn.analyze.vo.IpaddressRiskMetricsQueryVo;
import com.qn.common.base.BaseControlle;
import com.qn.common.base.model.ResponseRows;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import org.apache.dubbo.config.annotation.DubboReference;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * qingniu-cloud user source analysis
 *
 * @Author: TXG
 * @Date: 2024/6/11
 * @Version V0.0.2
 */
@Tag(name = "系统-IP4指标统计")
@SaCheckLogin
@RestController
@RequestMapping("ip4/metrics")
public class IpAddressMetricsController extends BaseControlle {
    @DubboReference(version = "1.0.0")
    private IpAddressMetricsService service;
    @Operation(summary ="大洲统计-列表")
    @PostMapping("getContinentList")
    @SaIgnore
    public ResponseRows<IpAddressMetrics> getContinentList(@RequestBody IpaddressMetricsQueryVo where){
        return successR(service.getContinentList(where));
    }
    @Operation(summary ="国家统计-列表")
    @PostMapping("getCountryList")
    @SaIgnore
    public ResponseRows<IpAddressMetrics> getCountryList(@RequestBody IpaddressMetricsQueryVo where){
        return successR(service.getCountryList(where));
    }
    @Operation(summary ="地区统计-列表")
    @PostMapping("getRegionList")
    @SaIgnore
    public ResponseRows<IpAddressMetrics> getRegionList(@RequestBody IpaddressMetricsQueryVo where){
        return successR(service.getRegionList(where));
    }
    @Operation(summary ="城市统计-列表")
    @PostMapping("getCityList")
    @SaIgnore
    public ResponseRows<IpAddressMetrics> getCityList(@RequestBody IpaddressMetricsQueryVo where){
        return successR(service.getCityList(where));
    }
    @Operation(summary ="宽带供应商统计-列表")
    @PostMapping("getANSList")
    @SaIgnore
    public ResponseRows<IpAddressMetrics> getAnsList(@RequestBody IpaddressMetricsQueryVo where){
        return successR(service.getAnsList(where));
    }
    @Operation(summary ="IP归属地时区统计-列表")
    @PostMapping("getTimezoneList")
    @SaIgnore
    public ResponseRows<IpAddressMetrics> getTimezoneList(@RequestBody IpaddressMetricsQueryVo where){
        return successR(service.getTimezoneList(where));
    }
    @Operation(summary ="IP风控统计-列表")
    @PostMapping("getRiskList")
    @SaIgnore
    public ResponseRows<IpAddressRiskMetrics> getRiskList(@RequestBody IpaddressRiskMetricsQueryVo where){
        return successR(service.getRiskList(where));
    }
    @Operation(summary ="IP归属国家统计-列表")
    @PostMapping("getCountryStatisticsList")
    @SaIgnore
    public ResponseRows<IpAddressMetrics> getCountryStatisticsList(@RequestBody IpaddressMetricsQueryVo where){
        return successR(service.getCountryStatisticsList(where));
    }

}